<?php


namespace App\Http\Requests;


use App\Validate\BaseValidate;

class DriversRequests extends BaseValidate
{
    //验证规则
    protected $rule =[
        'real_name' => 'required',
        'identity' => 'required',
        'identity_photo' => 'required',
        'licence_id' => 'required',
        'licence_photo' => 'required',
        'city' => 'required',
        'licence_end' => 'required|date_format:Y-m-d',
        'company_id' => 'required',
        'colour' => 'required',

    ];
    /**
     * @var array
     * 验证提示
     */
    protected $message = [
        'real_name.required'=>'真实姓名',
        'city.required'=>'接单城市',
        'identity.required'=>'请填写身份证',
        'identity_photo.required' =>'身份证正面照',
        'licence_id.required' =>'驾照类型',
        'licence_photo.required' =>'驾照必须',
        'licence_end.required' => '驾照有效期',
        'licence_end.date_format' => '驾照有效期格式不对',
        'company_id.required' => '所属公司',
        'car_num.required' => '车牌号',
        'restriction.required' => '限行',
        'people.required' => '载客人数',
        'colour.required' => '车辆颜色',
    ];

    //自定义场景
    protected $scene = [
        'edit'=>"real_name,city,identity,identity_photo,licence_id,licence_photo,licence_end,company_id",
        'add'=>"real_name,city,identity,identity_photo,licence_id,licence_photo,license_first,licence_end,company_id,car_num,restriction,people,colour",
    ];
}